package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SetmealDishMapper {

    // 根据菜品id查询关联的套餐数量
    Integer countSetmeal(List<Long> dishids);


    // 根据套餐id查询套餐和菜品的关联关系
    @Delete("delete from setmeal_dish where setmeal_id = #{id}")
    void deleteBySetmealId(Long id);

    // 批量插入套餐和菜品的关联关系
    void insertBatch(List<SetmealDish> setmealDishes);

    // 批量删除
    void deleteBySId(List<Long> ids);

    // 根据id查询套餐
    @Select("select * from setmeal_dish where id = #{id}")
    List<SetmealDish> selByid(Long id);
}
